import {createStackNavigator,createAppContainer} from 'react-navigation'
import {Easing,Animated} from 'react-native'
import HomePage from "../page/HomePage";
import ClassPage from "../page/ClassPage";
import PhotoPage from "../page/PhotoPage";


const AppNavigator=createStackNavigator({
    "HomePage":{
        screen: HomePage,
    },
    "ClassPage":{
        screen: ClassPage,
    },
    "PhotoPage":{
      screen: PhotoPage,
    }
},{
    initialRouteName:'PhotoPage',
    headerMode: 'screen',
    defaultNavigationOptions: {
            header: null,
            gesturesEnabled: true
     },
     transitionConfig: () => ({
        transitionSpec: {
          duration: 300,
          easing: Easing.out(Easing.poly(4)),
          timing: Animated.timing,
        },
        screenInterpolator: sceneProps => {
          const { layout, position, scene } = sceneProps;
          const { index } = scene;
  
          const width = layout.initWidth;
          const translateX = position.interpolate({
            inputRange: [index - 1, index, index + 1],
            outputRange: [width, 0, 0],
          });
  
          const opacity = position.interpolate({
            inputRange: [index - 1, index - 0.99, index],
            outputRange: [0, 1, 1],
          });
  
          return { opacity, transform: [{ translateX }] };
        },
      })
});
const AppContainer =createAppContainer(AppNavigator);
export default AppContainer;


